package org.windowkit.toolkit.widget.table;

import java.util.Comparator;

import javax.swing.table.TableModel;

import org.ddevil.data.SortOrder;
import org.windowkit.toolkit.widget.table.event.TableEditedListener;



/**
 * An interface that describes a TableModel capable of sorting and filtering.
 * DataSet implementation.
 *
 * XXX Still in development
 *
 * @author Rich O'Connell
 *
 */
public interface SortableTableModel extends TableModel {


    public void addTableEditedListener(TableEditedListener l);
    public void removeTableEditedListener(TableEditedListener l);


    boolean getIsRowSelectable(int row);
    int getDataRowCount();
    void setVisibleRows(int i);
    int getVisibleRows();


    void removeRow(int index);

    void clearTableData(boolean clearSortsAndFilters);


    void setSortable(boolean isSortable);
    boolean isSortable();
    void setComparator(Class className, Comparator myComparator);
    void setComparator(int colIndex, Comparator myComparator);
    void setSort(int column, SortOrder type);
    void clearAllSorts();
    SortOrder getSortDirection(int column);
    int getSortDepth(int column);



    void setFilterable(boolean isFilterable);
    boolean isFilterable();
    void setFilter(int column, String filter);
    void setNegateFilter(boolean negate);


}
